<template>
  <div class="addrs-item" :class="{ active: select }">
    <div class="top">
      <div class="name">{{ addr.contact }}（收）</div>
      <div class="phone">{{ addr.phone }}</div>
      <icon v-if="select" name="icongouxuan" />
    </div>
    <div class="gate_name">档口名称：{{ addr.gate_name }}</div>
    <div class="addrs">
      地址：{{ addr.province + addr.city + addr.area + addr.detail }}
    </div>
    <div class="action">
      <div class="edit">修改</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "AddrsItem1",
  props: {
    select: Boolean,
    addr: Object,
  },
};
</script>

<style lang="scss" scoped>
.addrs-item {
  width: 284px;
  height: 140px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #dedede;
  &.active {
    border: 1px solid #d52c1a;
    .top {
      background: #d52c1a;
      color: #ffffff;
    }
  }
  .top {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    background: #f3f5f9;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    padding: 0 12px;
    .name {
      margin-right: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .phone {
      flex: 1;
    }
  }
  .gate_name {
    padding: 12px 12px 0;
    font-size: 14px;
    font-weight: 400;
    color: #333333;
    line-height: 20px;
  }
  .addrs {
    padding: 5px 12px 10px;
    font-size: 14px;
    font-weight: 400;
    color: #333333;
    line-height: 20px;
  }
  .action {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 400;
    color: #ea968d;
    line-height: 20px;
    display: flex;
    justify-content: flex-end;
    .edit {
      cursor: pointer;
    }
  }
}
</style>
